home *** CD-ROM | disk | FTP | other *** search
/ Power Hacker 2003 / Power_Hacker_2003.iso / Exploit and vulnerability / hoobie / irix-login.txt < prev    next >
Encoding:
Text File  |  2001-11-06  |  2.9 KB  |  57 lines

  1.  
  2. Several modern unixes provide configuration options for security and logging
  3. in a file called /etc/default/login.  Irix, and I assume some others but
  4. perhaps it's an Irix invention, includes a variable "LOCKOUT" which causes an
  5. account with a specified number of incorrect login attempts in a row to be
  6. locked (one successful login resets the count).  This seems like a really good
  7. idea, especially if you set the variable high enough that no one would ever be
  8. locked out through mistakes whereas any automated password guessing program
  9. (which ran over the net by telnetting in) would be stopped.  Since one
  10. successful login clears the record, people are not able to accumulate the
  11. requisite number of failures over an extended period of time so as to be
  12. suddenly surprised one day.  It should be good, if not for the following
  13. serious security flaw, at least in Irix, checked in both 5.3 and 6.2.
  14.  
  15. Login maintains the LOCKOUT-related data in the directory /var/adm/badlogin,
  16. which it creates when first needed.  Each logname gets a one byte file; that
  17. byte is the number of failed login attempts.
  18.  
  19. Some time after turning it on, I looked again at /var/adm/badlogin and was
  20. astonished to find quite a lot of stuff in there.  It seems that whatever you
  21. type to "login:" gets counted as a logname for LOCKOUT purposes.  So this
  22. directory contained misspellings, and garbage, and line noise, AND passwords...
  23.  
  24. But that's not all.  Since it doesn't check the logname, you can type
  25. pathnames.  Try this:
  26.  
  27.         IRIX (loser.net)
  28.  
  29.         login: ../../../etc/something
  30.         Password:
  31.         UX:login: ERROR: Login incorrect
  32.  
  33. You've now created an /etc/something.  This works.
  34.  
  35. I can't always overwrite existing files; I'm not sure why because sometimes I
  36. can.  But it doesn't truncate the file, it just increments the first byte.
  37. So the exploit is not obvious.  Those of you who see how to exploit this,
  38. please keep it to yourself until people have some time to remove the LOCKOUT
  39. feature setting from their /etc/default/logins on irix, and on whatever other
  40. unixes share this lockout feature and also share the misplaced logging.
  41.  
  42. So everybody, please disable the LOCKOUT parameter in /etc/default/logins on
  43. irixes by setting it to zero or commenting it out (that's how it ships), and
  44. on whatever other unix platforms have it and have this security problem.
  45. It's easily tested by telnetting as in the above example and then checking for
  46. the existence of /etc/something.
  47.  
  48. For the vendor(s), the fix is obvious:  Only valid lognames should be logged
  49. to /var/adm/badlogin, because that's all the information that's needed
  50. anyway.  The purpose of this logging is to lock accounts from repeated bad
  51. login attempts.  There's no such thing as locking a non-account.  Failed
  52. logins are already logged in syslog.  So it's a question of moving the logging
  53. inside an 'if' where it should have been for many reasons, including simply
  54. the growing amount of garbage in my /var/adm/badlogin until I turned LOCKOUT
  55. off this morning.
  56.  
  57.